﻿using System;
using System.Collections.Generic;
using UnityEngine;

// Token: 0x0200002C RID: 44
public class VrPlayerSpawnBehaviour : MonoBehaviour
{
	// Token: 0x060000C0 RID: 192 RVA: 0x00010481 File Offset: 0x0000E681
	private void Start()
	{
		this.body = base.GetComponent<BodyScript>();
		this.weapons.AddRange(Resources.LoadAll<GameObject>("Weapon"));
	}

	// Token: 0x060000C1 RID: 193 RVA: 0x000104A4 File Offset: 0x0000E6A4
	private void Update()
	{
		if (Input.GetKeyDown(KeyCode.G) && this.body.health / this.body.maxHealth > 0.4f && !this.body.holdingMain)
		{
			this.body.health *= 0.35f;
			Object.Instantiate<GameObject>(this.weapons[Random.Range(0, this.weapons.Count)], this.body.torso.transform.position, Quaternion.Euler(0f, 0f, Random.Range(0f, 360f)));
			this.body.Pickup(null);
		}
	}

	// Token: 0x040001A0 RID: 416
	private BodyScript body;

	// Token: 0x040001A1 RID: 417
	private List<GameObject> weapons = new List<GameObject>();
}
